package com.woniuxy.cloud.carl.order.client;

import com.woniuxy.cloud.carl.order.client.result.OrderDetailDto;
import com.woniuxy.cloud.carl.order.client.result.OrderItemDto;
import com.woniuxy.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


@FeignClient(contextId = "orderQueryClient",name = "order",path = "order")
public interface OrderQueryClient {

    @GetMapping("byUserId")
    public Result getUserOrder(@RequestParam("userId") Long userId);

    @GetMapping("orderByNum")
    public Result<OrderDetailDto> getOrderByNum(@RequestParam("orderNum") String orderNum);


    @GetMapping("orderById")
    public Result<OrderDetailDto> getOrderDetail(@RequestParam("orderId") Long orderId);

    @GetMapping("forStore")
    public Result getOrderForStore(@RequestParam("storeId") Long storeId);

    @GetMapping("orderItem")
    public Result<OrderItemDto> getOrderItemDetail(@RequestParam("orderItemId") Long orderItemId);

    @GetMapping("byStoreId")
    public Result<List<OrderItemDto>> getStoreOrder(@RequestParam("storeId") Long storeId);


}
